        <?php include("header.php");?>
        <link rel="stylesheet/less" href="<?php echo ASTRA_THEME_URI; ?>css/new.less">
        <?php include("nav.php");?>
			<div class="new_banner">
				<div class="warp">
					<div class="title-name">新闻中心</div>
					<div class="flex">
						<el-carousel trigger="click" height="400px">
							<?php $category = 5;?>
							<?php $display_categories = array($category); foreach ($display_categories as $category) { ?>
							<?php query_posts("showposts=4&cat=$category&tag=hot")?>
							<?php while (have_posts()) : the_post(); ?>
							<el-carousel-item>
								<a href="<?php the_permalink() ?>">
									<div class="img-box">
										<img src="<?php echo catch_that_image() ?>" />
									</div>
									<div class="cont">
										<span>最火</span>
										<p class="line-clamp"><?php the_title(); ?></p>
									</div>
								</a>
							</el-carousel-item>
							<?php endwhile; ?>	
							<?php } wp_reset_query();?>
						</el-carousel>
						<div class="news_right">
						    <?php $display_categories = array($category); foreach ($display_categories as $category) { ?>
						    <?php query_posts("showposts=5&cat=$category&tag=new")?>
						    <?php while (have_posts()) : the_post(); ?>
								<div class="new_li">
									<a href="<?php the_permalink() ?>">
										<div class="img-box">
											<img src="<?php echo catch_that_image() ?>" />
										</div>
										<div class="cont">
											<span>最新</span>
											<p class="line-clamp"><?php the_title(); ?></p>
										</div>
									</a>
								</div>
						    <?php endwhile; ?>	
						    <?php } wp_reset_query();?>
							
						</div>
					</div>
				</div>
			</div>

			<div class="news-l" id="F2">
				<div class="new-list-1 warp flex">
					<div class="new-left-1">
						<div class="new-tab-1">
							<?php $c= get_current_category_id() ?>
							<a href="<?php echo esc_url( home_url( '/' ) ); ?>news" class="tab-list <?php if($c == 5){ echo 'tab-active';} ?>">全部</a>
							<?php
							$a= 5;
							$args=array(
							'orderby'    => 'id',
							'hide_empty' => "0",
							'child_of' => $a,//可以换为：'child_of' => '1',
							);
							$categories=get_categories($args);
							foreach($categories as $category) {
							?>
							<a href="<?php echo get_category_link( $category->term_id ) ?>#F2 " class="tab-list <?php if($c == $category->term_id){ echo 'tab-active';} ?>" ><?php echo $category->name; ?></a>
							<?php }?>
						</div>
						<?php $c= get_current_category_id() ?>
						   <?php
						     global $post;
						     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
						     /** 用WP_Query获取posts */
						     $args = array(
						         'category__in'         => $c,     // 分类id
						         'paged'                => $paged,
						     );
						     $post_list = new WP_Query($args);					      
						    ?>
							<?php if ( $post_list->have_posts() ) : ?>
								 <?php while ( $post_list->have_posts() ) : $post_list->the_post(); ?>
									<div class="list">
										<div class="f-img">
											<a href="<?php the_permalink() ?>"><img src="<?php echo catch_that_image() ?>" /></a>
										</div>
										<div class="cont-text">
										    <span><?php the_time('Y年n月j日'); ?></span>
											<a href="<?php the_permalink() ?>">
												<h3 class='line-clamp'><?php the_title(); ?></h3>
											</a>
											<p><?php the_excerpt(); ?></p>
											<!-- <div class="label">
												<a>AI行为识别技术</a><i>|</i><a>AI行为识别技术</a>
											</div> -->
										</div>
									</div> 
							<?php endwhile; ?>
							<?php endif; wp_reset_postdata();?>
							
							<div class="no-data" v-if="<?php echo get_category(get_current_category_id())->count;?> == 0">
									<img src="<?php echo ASTRA_THEME_URI; ?>img/icon/icon_none_data.png" />
							</div>
						<!--配置WP-PageNavi 分页导航代码-->
						<div style="text-align:center;padding:20px;margin-top:50px;" v-if="<?php echo get_category(get_current_category_id())->count;?> > 0"><?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?></div>
					</div>
                    <div class="new-right-1">
						<div class="title">热门资讯</div>
						<?php $category = 5;?>
						<?php $display_categories = array($category); foreach ($display_categories as $category) { ?>
						<?php query_posts("showposts=5&cat=$category&tag=hot")?>
						<?php $index = 1;?>
						<?php while (have_posts()) : the_post(); ?>
						<div class="rank">
							<span><?php echo $index;?></span>
							<a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title()', $post->post_title)), 0,40,""); ?></a>
						</div>
						<?php $index++;?>
						<?php endwhile; ?>
						
						<?php } wp_reset_query();?>
					</div>
				</div>

			</div>

			<?php include("footer.php");?>
			<script>
				new Vue({
					el: '#app',
					data: function() {
						return {

						}
					},
					created() {

					},
					mounted() {

					},
					methods: {

					}
				})
			</script>
	</body>
</html>